var {data} = require('./src/mock')
module.exports = {
    lintOnSave: false,
    devServer: {
        before(app) {
            app.get('/api/list', (req,res) => {
                res.json({
                    code:1,
                    data: data.list
                })
            })
            app.get('/api/swiper',(req,res) => {
                let {type} = req.query;
                let imgList;
                if(type === '1') {
                    imgList = [
                        'http://img5.imgtn.bdimg.com/it/u=2784148584,2183552205&fm=26&gp=0.jpg',
                        'http://img3.imgtn.bdimg.com/it/u=1195811257,1374531866&fm=26&gp=0.jpg',
                        'http://img3.imgtn.bdimg.com/it/u=3204669317,3729078410&fm=11&gp=0.jpg'
                    ]
                } else {
                    imgList = [
                        'http://img4.imgtn.bdimg.com/it/u=3324650843,4203827181&fm=26&gp=0.jpg',
                        'http://img1.imgtn.bdimg.com/it/u=280591509,585529894&fm=26&gp=0.jpg',
                        'http://img4.imgtn.bdimg.com/it/u=1913697520,1010929488&fm=26&gp=0.jpg'
                    ]
                }
                res.json({
                    code:1,
                    data: imgList,
                })
            })
        }
    }
}